package refactor.replaceconstructorwithfactorymethod;

public class Employee {
    private int type;
    public static final int ENGINEER = 1;
    public static final int SALESMAN = 2;
    public static final int MANAGER = 3;
    private int monthlySalary;
    private int commission;
    private int bonus;

    public Employee() {
    }

    public Employee(int type) {
        this.type = type;
    }

   /* public static Employee create(int type) {

    }*/

    public static Employee createEngineer() {
        return new Engineer();
    }

    public int calcPayAmount() {
        switch (type) {
            case ENGINEER:
                return monthlySalary;
            case SALESMAN:
                return monthlySalary + commission;
            case MANAGER:
                return monthlySalary + bonus;
            default:
                throw new RuntimeException("Incorrect Employee");
        }
    }
}
